home *** CD-ROM | disk | FTP | other *** search
/ The 640 MEG Shareware Studio 2 / The 640 Meg Shareware Studio CD-ROM Volume II (Data Express)(1993).ISO / utility / v11n02.zip / SETUP.C < prev    next >
C/C++ Source or Header  |  1991-12-08  |  18KB  |  517 lines

  1. /***************************************************************************
  2.  
  3.     SETUP.C program to read the current configuration of PCREMOT2 and allow
  4.     the user to modify the configuration.
  5.  
  6.     Compiled with Microsoft C version 5.1 and 6.0
  7.  
  8.  ***************************************************************************/
  9.  
  10. #include <fcntl.h>
  11. #include <sys\types.h>
  12. #include <sys\stat.h>
  13. #include <io.h>
  14. #include <stdio.h>
  15. #include <string.h>
  16. #include <stdlib.h>
  17. #include <conio.h>
  18. #include <bios.h>
  19.  
  20. #define TRUE  1
  21. #define FALSE 0
  22.  
  23. struct config {
  24.    char cManned_flag;      /* 0-unattended, 1-manned mode */
  25.    char cComm_flag;        /* 0-comm1, 1-comm2, 2-comm3, 3-comm4 */
  26.    int  iComm_port3;       /* port address for comm port 3 */
  27.    int  iComm_port4;       /* port address for comm port 4 */
  28.    char cComm3_int;        /* interrupt number for comm port 3 */
  29.    char cComm4_int;        /* interrupt number for comm port 4 */
  30.    char cSpeed_flag;       /* 0-1200, 1-2400, 2-4800, 3-9600 */
  31.    char cDesnow_flag;      /* 0-NO desnow, 1-desnow */
  32.    char cNull_modem;       /* 0-modem, 1-null modem cable */
  33.    char cSmile_flag;       /* 0-NO smile, 1-smile, you're on candid camera */
  34.    char cZero1;
  35.     unsigned char cClear_code;    /* alt key combination to clear the screen */
  36.    char cZero2;
  37.    unsigned char cExit_code;  /* alt key combination to exit pcremote */
  38.    char cZero3;
  39.    unsigned char cShell_code; /* alt key combination to shell to DOS */
  40.    char cZero4;
  41.    unsigned char cTransfer_code;/* alt key combination to start a file transfer */
  42.    int  iPassword_size;    /* length of the password */
  43.    char crgPassword[20];   /* secret password */
  44.    char szModem_setup5[30];   /* custom modem setup string */
  45.     char szDial[4];            /* dial string */
  46. } stOldConfig, stNewConfig;
  47.  
  48. unsigned char Ascii_code[] = "QWERTYUIOPASDFGHJKLZXCVBNMQ    ";
  49. unsigned char Scan_code[] = { 16,17,18,19,20,21,22,23,24,25,30,
  50.                                         31,32,33,34,35,36,37,38,44,45,46,47,
  51.                                         48,49,50,16 };
  52.  
  53. char szMannedPrompt[]   = "1  - Host/Remote mode.       ";
  54. char szCommPrompt[]     = "2  - Communications port.    ";
  55. char szSpeedPrompt[]    = "3  - Communications speed.   ";
  56. char szDesnowPrompt[]   = "4  - Enable/disable desnow.  ";
  57. char szNullPrompt[]     = "5  - Modem/Null modem.       ";
  58. char szSmilePrompt[]    = "6  - Enable/disable smile.   ";
  59. char szClearPrompt[]    = "7  - Redisplay screen key.   ";
  60. char szExitPrompt[]     = "8  - Exit PCREMOT2 key.      ";
  61. char szShellPrompt[]    = "9  - Shell to DOS key.       ";
  62. char szTransferPrompt[] = "10 - File transfer key.      ";
  63. char szPasswordPrompt[] = "11 - Password.               ";
  64. char szSetupPrompt[]    = "12 - Modem setup string.     ";
  65. char szDialPrompt[]        = "13 - Tone/Pulse dial.        ";
  66. char szSaveExit[]       = "14 - Save new configuration. ";
  67. char szNosaveExit[]     = "15 - Exit, do not save.      ";
  68.  
  69. char szPcremoteFile[]  = "pcremot2.com";    /* name of the pcremote file */
  70. char szZcopyFile[]     = "zcopy.com";       /* name of the zcopy file */
  71.  
  72. #define PCREMOTEOFFSET 3   /* offset from start of file to config offset */
  73. #define ZCOPYOFFSET 6      /* offset from start of file to config offset */
  74.  
  75. int iPcremoteOffset;     /* offset from start of file to config */
  76. int iZcopyOffset;        /* offset from start of file to config */
  77.  
  78. char szSelection[40];    /* buffer to get the user selection */
  79. int  iSelection;            /* user selections converted to int */
  80.  
  81. /* function declarations */
  82. int ReadPcremoteConfig(void);
  83. int WritePcremoteConfig(void);
  84. int WriteZcopyConfig(void);
  85. int Old2New(void);
  86. int DisplayConfig(void);
  87. int GetAltKey(char *);
  88. int GetNewCommPort(void);
  89. int GetNewBaudRate(void);
  90. int GetNewPassword(void);
  91. int GetNewModemSetup(void);
  92.  
  93. main()
  94. {
  95.    /* open the pcremote.com file and read the offset to the configuration */
  96.    if(ReadPcremoteConfig()) return(1);
  97.    Old2New();
  98.    while(TRUE)
  99.    {
  100.       DisplayConfig();
  101.         gets(szSelection);    /* get response from the user */
  102.         iSelection=atoi(szSelection);    /* convert to a number */
  103.         switch(iSelection)
  104.         {
  105.             case 1:
  106.                 stNewConfig.cManned_flag = stNewConfig.cManned_flag ? (char)0 : (char)1 ;
  107.                 break;
  108.             case 2:
  109.                 GetNewCommPort();
  110.                 break;
  111.             case 3:
  112.                 GetNewBaudRate();
  113.                 break;
  114.             case 4:
  115.                 stNewConfig.cDesnow_flag = stNewConfig.cDesnow_flag ? (char)0 : (char)1 ;
  116.                 break;
  117.             case 5:
  118.                 stNewConfig.cNull_modem = stNewConfig.cNull_modem ? (char)0 : (char)1 ;
  119.                 break;
  120.             case 6:
  121.                 stNewConfig.cSmile_flag = stNewConfig.cSmile_flag ? (char)0 : (char)1 ;
  122.                 break;
  123.             case 7:
  124.                 GetAltKey(&stNewConfig.cClear_code);
  125.                 break;
  126.             case 8:
  127.                 GetAltKey(&stNewConfig.cExit_code);
  128.                 break;
  129.             case 9:
  130.                 GetAltKey(&stNewConfig.cShell_code);
  131.                 break;
  132.             case 10:
  133.                 GetAltKey(&stNewConfig.cTransfer_code);
  134.                 break;
  135.             case 11:
  136.                 GetNewPassword();
  137.                 break;
  138.             case 12:
  139.                 GetNewModemSetup();
  140.                 break;
  141.             case 13:
  142.                 if(stNewConfig.szDial[3] == 'T')
  143.                     stNewConfig.szDial[3] = 'D';
  144.                 else
  145.                     stNewConfig.szDial[3] = 'T';
  146.                 break;
  147.             case 14:
  148.                 WritePcremoteConfig();
  149.                 return(0);
  150.             case 15:
  151.                 return(0);
  152.         }
  153.    }
  154. }
  155.  
  156. int ReadPcremoteConfig()
  157. {
  158.    int hFile;  /* handle to the open pcremote.com file */
  159.    if((hFile=open(szPcremoteFile, O_RDONLY|O_BINARY))==-1)  /* open the pcremote.com file */
  160.    {
  161.       printf("\nUnable to open PCREMOT2.COM\n");
  162.       return(1);
  163.    }
  164.    if(lseek(hFile,(long) PCREMOTEOFFSET, SEEK_SET)==-1)  /* locate the config offset */
  165.    {
  166.       printf("\nUnable to read PCREMOT2 configuration.\n");
  167.       close(hFile);
  168.       return(1);
  169.    }
  170.    if(read(hFile,(char *) &iPcremoteOffset, 2)!=2)   /* read the config offset */
  171.    {
  172.       printf("\nUnable to read PCREMOT2 configuration.\n");
  173.       close(hFile);
  174.       return(1);
  175.    }
  176.    iPcremoteOffset+=PCREMOTEOFFSET;  /* adjust for the start of the file */
  177.    if(lseek(hFile,(long) iPcremoteOffset, SEEK_SET)==-1)  /* locate the config */
  178.    {
  179.       printf("\nUnable to read PCREMOT2 configuration.\n");
  180.       close(hFile);
  181.       return(1);
  182.    }
  183.    /* read the old configuration */
  184.    if(read(hFile,(char *) &stOldConfig, sizeof(struct config))!=sizeof(struct config))
  185.    {
  186.       printf("\nUnable to read PCREMOT2 configuration.\n");
  187.       close(hFile);
  188.       return(1);
  189.    }
  190.    close(hFile);  /* read the configuration so close the file */
  191.    return(0);
  192. }
  193.  
  194. int WritePcremoteConfig()
  195. {
  196.    int hFile;  /* handle to the open pcremote.com file */
  197.    if((hFile=open(szPcremoteFile, O_WRONLY|O_BINARY))==-1)  /* open the pcremote.com file */
  198.    {
  199.       printf("\nUnable to open PCREMOT2.COM.\n");
  200.       return(1);
  201.    }
  202.    if(lseek(hFile,(long) iPcremoteOffset, SEEK_SET)==-1)  /* locate the config */
  203.    {
  204.       printf("\nUnable to open PCREMOT2.COM.\n");
  205.       close(hFile);
  206.       return(1);
  207.    }
  208.    /* write the new configuration */
  209.    if(write(hFile,(char *) &stNewConfig, sizeof(struct config))!=sizeof(struct config))
  210.    {
  211.       printf("\nUnable to write PCREMOT2 configuration.\n");
  212.       close(hFile);
  213.       return(1);
  214.    }
  215.    close(hFile);  /* wrote the configuration so close the file */
  216.     /* if comm port 3 or 4 is selected then copy the port configuration
  217.         to zcopy.com */
  218.     if(stNewConfig.cComm_flag==2 || stNewConfig.cComm_flag==3)
  219.         WriteZcopyConfig();
  220.    return(0);
  221. }
  222.  
  223. int WriteZcopyConfig()
  224. {
  225.    int hFile;  /* handle to the open zcopy.com file */
  226.    if((hFile=open(szZcopyFile, O_RDWR|O_BINARY))==-1)  /* open the zcopy.com file */
  227.    {
  228.       printf("\nUnable to open ZCOPY.COM\n");
  229.       return(1);
  230.    }
  231.    if(lseek(hFile,(long) ZCOPYOFFSET, SEEK_SET)==-1)  /* locate the config offset */
  232.    {
  233.       printf("\nUnable to read ZCOPY configuration.\n");
  234.       close(hFile);
  235.       return(1);
  236.    }
  237.    if(read(hFile,(char *) &iZcopyOffset, 2)!=2)   /* read the config offset */
  238.    {
  239.       printf("\nUnable to read ZCOPY configuration.\n");
  240.       close(hFile);
  241.       return(1);
  242.    }
  243.    iZcopyOffset+=(ZCOPYOFFSET+6);  /* adjust for the start of the file */
  244.    if(lseek(hFile,(long) iZcopyOffset, SEEK_SET)==-1)  /* locate the config */
  245.    {
  246.       printf("\nUnable to read ZCOPY configuration.\n");
  247.       close(hFile);
  248.       return(1);
  249.    }
  250.    /* write the new configuration */
  251.    if(write(hFile,(char *) &stNewConfig.iComm_port3, 2)!=2)
  252.    {
  253.       printf("\nUnable to write ZCOPY configuration.\n");
  254.       close(hFile);
  255.       return(1);
  256.    }
  257.    if(write(hFile,(char *) &stNewConfig.cComm3_int, 1)!=1)
  258.    {
  259.       printf("\nUnable to write ZCOPY configuration.\n");
  260.       close(hFile);
  261.       return(1);
  262.    }
  263.    if(write(hFile,(char *) &stNewConfig.iComm_port4, 2)!=2)
  264.    {
  265.       printf("\nUnable to write ZCOPY configuration.\n");
  266.       close(hFile);
  267.       return(1);
  268.    }
  269.    if(write(hFile,(char *) &stNewConfig.cComm4_int, 1)!=1)
  270.    {
  271.       printf("\nUnable to write ZCOPY configuration.\n");
  272.       close(hFile);
  273.       return(1);
  274.    }
  275.     close(hFile);  /* read the configuration so close the file */
  276.    return(0);
  277. }
  278.  
  279. int Old2New()
  280. /* copy the current configuration to the new configuration parameters */
  281. {
  282.    stNewConfig.cManned_flag = stOldConfig.cManned_flag ;
  283.    stNewConfig.cComm_flag = stOldConfig.cComm_flag ;
  284.    stNewConfig.iComm_port3 = stOldConfig.iComm_port3 ;
  285.    stNewConfig.iComm_port4 = stOldConfig.iComm_port4 ;
  286.    stNewConfig.cComm3_int = stOldConfig.cComm3_int ;
  287.    stNewConfig.cComm4_int = stOldConfig.cComm4_int ;
  288.    stNewConfig.cSpeed_flag = stOldConfig.cSpeed_flag ;
  289.    stNewConfig.cDesnow_flag = stOldConfig.cDesnow_flag ;
  290.    stNewConfig.cNull_modem = stOldConfig.cNull_modem ;
  291.    stNewConfig.cSmile_flag = stOldConfig.cSmile_flag ;
  292.    stNewConfig.cClear_code = stOldConfig.cClear_code ;
  293.    stNewConfig.cExit_code = stOldConfig.cExit_code ;
  294.    stNewConfig.cShell_code = stOldConfig.cShell_code ;
  295.    stNewConfig.cTransfer_code = stOldConfig.cTransfer_code ;
  296.    stNewConfig.iPassword_size = stOldConfig.iPassword_size ;
  297.     stNewConfig.cZero1=stOldConfig.cZero1;
  298.     stNewConfig.cZero2=stOldConfig.cZero2;
  299.     stNewConfig.cZero3=stOldConfig.cZero3;
  300.     stNewConfig.cZero4=stOldConfig.cZero4;
  301.    strncpy(stNewConfig.crgPassword, stOldConfig.crgPassword, sizeof(stOldConfig.crgPassword));
  302.    strncpy(stNewConfig.szModem_setup5, stOldConfig.szModem_setup5, sizeof(stOldConfig.szModem_setup5));
  303.     strncpy(stNewConfig.szDial, stOldConfig.szDial, sizeof(stOldConfig.szDial));
  304.    return(0);
  305. }
  306.  
  307. int DisplayConfig()
  308. /* display the new configuration parameters */
  309. {
  310.     int iLoop;
  311.     char *psTemp;
  312.    char szBuffer[80];   /* temporary buffer to assemble a line */
  313.    printf("\n\n\n\n\n\n\n");   /* blank the screen the easy way */
  314.     printf("PCREMOT2 configuration program.\nModifies the default configuration.\n\n");
  315.    /* display the manned flag */
  316.    strcat(strcpy(szBuffer, szMannedPrompt), stNewConfig.cManned_flag ? "manned" : "host");
  317.    printf("%s\n", szBuffer);
  318.    /* display the current communications port */
  319.    strcpy(szBuffer, szCommPrompt);
  320.    sprintf(strchr(szBuffer,0), "%d", stNewConfig.cComm_flag+1);
  321.    printf("%s\n", szBuffer);
  322.    /* display the current speed flag */
  323.    strcpy(szBuffer, szSpeedPrompt);
  324.    switch(stNewConfig.cSpeed_flag)
  325.    {
  326.       case 0:
  327.          strcat(szBuffer, "1200 baud");
  328.          break;
  329.       case 1:
  330.          strcat(szBuffer, "2400 baud");
  331.          break;
  332.       case 2:
  333.          strcat(szBuffer, "4800 baud");
  334.          break;
  335.       case 3:
  336.          strcat(szBuffer, "9600 baud");
  337.          break;
  338.       case 4:
  339.          strcat(szBuffer, "19200 baud");
  340.          break;
  341.       case 5:
  342.          strcat(szBuffer, "38400 baud");
  343.          break;
  344.    }
  345.    printf("%s\n", szBuffer);
  346.    /* display the current desnow flag */
  347.    strcat(strcpy(szBuffer, szDesnowPrompt), stNewConfig.cDesnow_flag ? "enabled" : "disabled");
  348.    printf("%s\n", szBuffer);
  349.    /* display the current null modem flag */
  350.    strcat(strcpy(szBuffer, szNullPrompt), stNewConfig.cNull_modem ? "null modem" : "modem");
  351.    printf("%s\n", szBuffer);
  352.    /* display the current smile flag */
  353.    strcat(strcpy(szBuffer, szSmilePrompt), stNewConfig.cSmile_flag ? "enabled" : "disabled");
  354.    printf("%s\n", szBuffer);
  355.     /* display the clear alt key code */
  356.     for(iLoop=0;iLoop<sizeof(Scan_code)&& Scan_code[iLoop]!=stNewConfig.cClear_code; iLoop++);
  357.     strcat(strcpy(szBuffer, szClearPrompt),"Alt-");
  358.     *(strchr(szBuffer,0)+1)=0;
  359.     *strchr(szBuffer,0)=Ascii_code[iLoop];
  360.    printf("%s\n", szBuffer);
  361.     /* display the exit pcremote alt key */
  362.     for(iLoop=0;iLoop<sizeof(Scan_code)&& Scan_code[iLoop]!=stNewConfig.cExit_code; iLoop++);
  363.     strcat(strcpy(szBuffer, szExitPrompt),"Alt-");
  364.     *(strchr(szBuffer,0)+1)=0;
  365.     *strchr(szBuffer,0)=Ascii_code[iLoop];
  366.    printf("%s\n", szBuffer);
  367.     /* display the shell to DOS alt key */
  368.     for(iLoop=0;iLoop<sizeof(Scan_code)&& Scan_code[iLoop]!=stNewConfig.cShell_code; iLoop++);
  369.     strcat(strcpy(szBuffer, szShellPrompt),"Alt-");
  370.     *(strchr(szBuffer,0)+1)=0;
  371.     *strchr(szBuffer,0)=Ascii_code[iLoop];
  372.    printf("%s\n", szBuffer);
  373.     /* display the file transfer alt key */
  374.     for(iLoop=0;iLoop<sizeof(Scan_code)&& Scan_code[iLoop]!=stNewConfig.cTransfer_code; iLoop++);
  375.     strcat(strcpy(szBuffer, szTransferPrompt),"Alt-");
  376.     *(strchr(szBuffer,0)+1)=0;
  377.     *strchr(szBuffer,0)=Ascii_code[iLoop];
  378.    printf("%s\n", szBuffer);
  379.     /* display the password, can't really display it though */
  380.     strcpy(szBuffer, szPasswordPrompt);
  381.     psTemp=strchr(szBuffer,0);    /* find the end of the string */
  382.     for(iLoop=0;iLoop<stNewConfig.iPassword_size; iLoop++, psTemp++)
  383.         *psTemp='*';
  384.     *psTemp=0;    /* terminate the string */
  385.    printf("%s\n", szBuffer);
  386.     /* display the custom modem setup5 sting */
  387.     strcat(strcpy(szBuffer, szSetupPrompt), stNewConfig.szModem_setup5);
  388.    printf("%s\n", szBuffer);
  389.     /* display the tone or dial pulse prompt */
  390.     if(stNewConfig.szDial[3]=='T')
  391.        strcat(strcpy(szBuffer, szDialPrompt), "Tone");
  392.     else 
  393.        strcat(strcpy(szBuffer, szDialPrompt), "Pulse");
  394.    printf("%s\n", szBuffer);
  395.     /* display the operator prompts */
  396.     strcat(strcpy(szBuffer,"\n"), szSaveExit);
  397.    printf("%s\n", szBuffer);
  398.     strcat(strcpy(szBuffer,""), szNosaveExit);
  399.    printf("%s\n", szBuffer);
  400.    printf("\nSelection: ");
  401.    return(0);
  402. }
  403.  
  404. int GetAltKey(cpNewKey)
  405. char *cpNewKey;    /* place to store new alt key value */
  406. {
  407.     char cTemp;    /* temporary character key */
  408.     unsigned iTemp;
  409.     int iLoop;
  410.     while(TRUE)
  411.     {
  412.         printf("\n\nEnter the new alt-key combination: ");
  413.         iTemp = _bios_keybrd(_KEYBRD_READ);
  414.         if((iTemp&0xff)==0)
  415.         {
  416.             cTemp=(char) (iTemp>>8)&0xff;
  417.             /* make sure the key is a valid key in the scan code array */
  418.             for(iLoop=0;iLoop<sizeof(Scan_code)&&Scan_code[iLoop]!=cTemp;iLoop++);
  419.             if(iLoop!=sizeof(Scan_code))    /* then it's a valid alt key */
  420.             {
  421.                 *cpNewKey=cTemp;
  422.                 return(0);
  423.             }
  424.             else printf("\nYou must use alpha keys only.");
  425.         }
  426.         if(cTemp==13) return(0);    /* check for carriage return key */
  427.         printf("\nYou must hold down the ALT key when you\nmake your selection.");
  428.     }
  429.     return(0);
  430. }
  431.  
  432. int GetNewCommPort()
  433. {
  434.     char cTemp;    /* temporary comm port number */
  435.     while(TRUE)
  436.     {
  437.         printf("\nEnter the new port number: ");
  438.         gets(szSelection);
  439.         if(strlen(szSelection)==9) return(0);    /* changed his mind */
  440.         cTemp=(char) atoi(szSelection);
  441.         if(cTemp>=1 && cTemp<=4)    /* make sure it's within range */
  442.         {
  443.             stNewConfig.cComm_flag=cTemp-1;
  444.             if(cTemp==3)    /* check for comm 3 */
  445.             {
  446.                 printf("\nCurrent Port address is %4X hex.", stNewConfig.iComm_port3);
  447.                 printf("\nEnter new port address or press Enter for no change: ");
  448.                 gets(szSelection);
  449.                 if(strlen(szSelection)) sscanf(szSelection, "%X", &stNewConfig.iComm_port3);
  450.                 printf("\nCurrent interrupt is %d.", stNewConfig.cComm3_int);
  451.                 printf("\nEnter the new interrupt or press Enter for no change: ");
  452.                 gets(szSelection);
  453.                 if(strlen(szSelection)) stNewConfig.cComm3_int=(char) atoi(szSelection);
  454.             }
  455.             if(cTemp==4)    /* check for comm 4 */
  456.             {
  457.                 printf("\nCurrent Port address is %4X hex.", stNewConfig.iComm_port4);
  458.                 printf("\nEnter new port address or press Enter for no change: ");
  459.                 gets(szSelection);
  460.                 if(strlen(szSelection)) sscanf(szSelection, "%X", &stNewConfig.iComm_port4);
  461.                 printf("\nCurrent interrupt is %d.", stNewConfig.cComm4_int);
  462.                 printf("\nEnter the new interrupt or press Enter for no change: ");
  463.                 gets(szSelection);
  464.                 if(strlen(szSelection)) stNewConfig.cComm4_int=(char) atoi(szSelection);
  465.             }
  466.             return(0);
  467.         }
  468.         printf("\nPort number must be 1, 2, 3, or 4.");
  469.     }
  470.     return(0);
  471. }
  472.  
  473. int GetNewBaudRate()
  474. {
  475.     char cTemp;    /* temporary baud rate number */
  476.     while(TRUE)
  477.     {
  478.         printf("\n1 for 1200 baud\n2 for 2400 baud\n3 for 4800 baud\n4 for 9600 baud");
  479.         printf("\n5 for 19200 baud\n6 for 38400 baud");
  480.         printf("\n\nEnter the new baud rate number: ");
  481.         gets(szSelection);
  482.         if(strlen(szSelection)==0) return(0);    /* changed his mind */
  483.         cTemp=(char) atoi(szSelection);
  484.         if(cTemp>=1 && cTemp<=6)    /* make sure it's within range */
  485.         {
  486.             stNewConfig.cSpeed_flag=cTemp-1;
  487.             return(0);
  488.         }
  489.         printf("\nBaud selection must be 1, 2, 3, 4, 5, or 6.");
  490.     }
  491.     return(0);
  492. }
  493.  
  494. int GetNewPassword()
  495. {
  496.     printf("\nEnter new password, maximum 20 characters: ");
  497.     gets(szSelection);
  498.     strupr(szSelection);    /* the password must be uppercase */
  499.     if(strlen(szSelection)==0) return(0);    /* changed his mind */
  500.     stNewConfig.iPassword_size=strlen(szSelection);
  501.     strncpy(stNewConfig.crgPassword, szSelection, sizeof(stNewConfig.crgPassword));
  502.     return(0);
  503. }
  504.  
  505. int GetNewModemSetup()
  506. {
  507.     printf("\nEnter modem setup string, maximum 30 characters: ");
  508.     gets(szSelection);
  509.     if(strlen(szSelection)==0) return(0);    /* changed his mind */
  510.     if(strlen(szSelection)<29)
  511.         strcat(strcpy(stNewConfig.szModem_setup5, szSelection), "\r");
  512.     return(0);
  513. }
  514.  
  515. /* end of file SETUP.C */
  516.  
  517.